<!--  -->
<template>
  <div class="box">
    子组件2

    {{ user.name }}
    {{ user.age }}

    <input type="text" v-model="user.name">
  </div>
</template>

<script lang='ts' setup>
import { reactive,toRefs,ref,inject} from 'vue'

let user= inject<any>("user");

</script>
<style scoped>
.box{
    width: 500px;
    height: 100px;
    background: yellow;
}
</style>